package com.lg.desireplayer.member;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;

import com.lg.desireplayer.R;
import com.lg.desireplayer.db.BandListMaker;

public class Intro extends Activity {

	ImageView intro;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.intro);

		new Thread(new Runnable() {

			@Override
			public void run() {
				
				dbUpdate();

				try {

					Thread.sleep(1300);
				} catch (Exception e) {

				}

				isIntro();
				finish();
			}

		}).start();

		new Thread(new Runnable() {

			@Override
			public void run() {

				try {

					Thread.sleep(2500);
				} catch (Exception e) {

				}

				fade();
				finish();
			}

		}).start();
	}

	private void dbUpdate() {

		// DB 정보 긁어오기
		BandListMaker.buildBandInfoList();
	}

	private void isIntro() {
		Intent intent = new Intent(Intro.this, Login.class);
		startActivity(intent);
	}

	private void fade() {
		overridePendingTransition(R.anim.alpha, R.anim.hold);
	}
}
